<?php
namespace App\Adshopuser\Controllers;
use App\Adshopuser\Models\BShopGoods;
use App\Adshopuser\Models\BShopOrder;
use Common\Common;
use Common\ControllerAdshopBase;

class TktransactionController extends ControllerAdshopBase
{

    public function initialize()
    {
        parent::initialize();
    }

    /**
     * 用户数据
     */
    public function platform_dataAction(){
        $BShopGoods = new BShopGoods();
        $result['goods_count'] = $BShopGoods->platform_data(['shop_id'=>$this->user_admin['id']]);

        $BShopOrderDb = new BShopOrder();
        $data['data_time'] = Common::timeChange(1);
        $data['shop_id'] = $this->user_admin['id'];
        $get_data = $BShopOrderDb->admin_get_order($data);
        $result['all_yestoday_order_count'] = $get_data['count'];
        $result['all_yestoday_order_price'] = $get_data['all_price'];

        $data1['data_time'] = Common::timeChange(1);
        $data1['shop_id'] = $this->user_admin['id'];
        $data1['status'] = 0;
        $get_data = $BShopOrderDb->admin_get_order($data1);
        $result['no_yestoday_order_count'] = $get_data['count'];
        $result['no_yestoday_order_price'] = $get_data['all_price'];

        $result['yes_yestoday_order_count'] = $result['all_yestoday_order_count'] - $get_data['no_yestoday_order_count'];
        $result['yes_yestoday_order_price'] = $result['all_yestoday_order_price'] - $result['no_yestoday_order_price'];
        $this->ok($result);
    }


    public function middle_listAction(){
        $result['all_user']=0;
        $result['invalid_count']=0;
        $result['invalid_percent']="0%";
        $result['jiesuan_commission']="0";
        $result['no_buyed_user']=10;
        $result['no_buyed_user_percent']="0%";
        $result['order_count']=0;
        $result['plus_user']=0;
        $result['sum_count']="0";
        $result['weiquan_count']=0;
        $result['weiquan_percent']="0%";
        $this->ok($result);
    }


    public function kerneldatabaseAction(){
        $result['order_count']=0;
        $result['sum_count']="0";
        $result['sum_income_count']="0";
        $this->ok($result);
    }

}
